/**
 * 
 */
package com.nwpusp.model;

import java.util.Vector;

/**
 * @author JustinCao
 *
 */
public abstract class EntityClassifyManager extends Vector<Entity> {

	protected EntityContainer globalContainer = null;
	protected TrackManager trackMgr = null;
	
	protected EntityClassifyManager(EntityContainer globalContainer, TrackManager trackMgr) {
		this.globalContainer = globalContainer;
		this.trackMgr = trackMgr;
	}
	
	public boolean add(Entity entity) {
		boolean result = super.add(entity);
		if(result && globalContainer != null) {
			result = globalContainer.add(entity);
		}
		return result;
	}
	
	public boolean remove(Entity entity) {
		boolean result = super.remove(entity);
		if(result) {
			result = globalContainer.remove(entity);
		}
		return result;
	}
	
}
